package com.business.task;

import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.business.commons.date.DateFormat;
import com.business.model.taskBat.TaobaoImportMsg;
import com.business.service.taskBat.TaobaoImportMsgService;

/**
 * spring task 定时任务测试，适用于单系统
 * 注意：不适合用于集群
 * @author L.cm
 */
@Component
public class TaobaoImportMsgDbBatTask {
	protected Logger logger = LogManager.getLogger(getClass());
	
	@Autowired private TaobaoImportMsgService taobaoImportMsgService;
	
	//@Scheduled(cron = "0 5/20 * * * ?")
	
	@Scheduled(fixedDelay = 20000)
	public void cronTest() {
		logger.debug("\n\n跑批任务--公众号数据导入开始。。。。。。" + DateFormat.getCurrentTime());
		TaobaoImportMsg taobaoImportMsg = new TaobaoImportMsg();
		taobaoImportMsgService.importMsgDBCall(taobaoImportMsg);
		logger.debug("跑批任务--公众号数据导入结束。。。。。。" + DateFormat.getCurrentTime());
	}
}
